package p270jp.pxv.android.legacy.constant;

import android.os.Parcel;
import android.os.Parcelable;
import p216hn.DefaultConstructorMarker;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p270jp.pxv.android.legacy.model.PixivWork;
import p325m0.MutabilityOwnership;

/* compiled from: ContentType.kt */
/* renamed from: jp.pxv.android.legacy.constant.ContentType */
/* loaded from: classes2.dex */
public enum ContentType implements Parcelable {
    ILLUST("illust"),
    MANGA("manga"),
    NOVEL("novel"),
    USER("user");
    
    private final String typeName;
    public static final C4247a Companion = new C4247a(null);
    public static final Parcelable.Creator<ContentType> CREATOR = new C4248b();

    /* compiled from: ContentType.kt */
    /* renamed from: jp.pxv.android.legacy.constant.ContentType$a */
    /* loaded from: classes2.dex */
    public static final class C4247a {
        public C4247a(DefaultConstructorMarker eVar) {
        }

        /* renamed from: a */
        public final ContentType m4608a(PixivWork pixivWork) {
            MutabilityOwnership.m3745m(pixivWork, "work");
            if (pixivWork instanceof PixivIllust) {
                return ((PixivIllust) pixivWork).getIllustType() == PixivIllust.Type.MANGA ? ContentType.MANGA : ContentType.ILLUST;
            }
            if (pixivWork instanceof PixivNovel) {
                return ContentType.NOVEL;
            }
            return null;
        }
    }

    /* compiled from: ContentType.kt */
    /* renamed from: jp.pxv.android.legacy.constant.ContentType$b */
    /* loaded from: classes2.dex */
    public static final class C4248b implements Parcelable.Creator<ContentType> {
        @Override // android.os.Parcelable.Creator
        public ContentType createFromParcel(Parcel parcel) {
            MutabilityOwnership.m3745m(parcel, "parcel");
            return ContentType.valueOf(parcel.readString());
        }

        @Override // android.os.Parcelable.Creator
        public ContentType[] newArray(int i) {
            return new ContentType[i];
        }
    }

    ContentType(String str) {
        this.typeName = str;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // java.lang.Enum, java.lang.Object
    public String toString() {
        return this.typeName;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i) {
        MutabilityOwnership.m3745m(parcel, "out");
        parcel.writeString(name());
    }
}
